package com.dhn.controller;

import com.dhn.entity.Sys_users;
import com.dhn.service.Sys_usersService;
import com.dhn.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
public class Sys_usersController {
    @Autowired
    private Sys_usersService sys_usersService;
    @RequestMapping("getSys_users")
    @ResponseBody
    public Object getSys_users(Sys_users sys_users){
        int abc = sys_usersService.getTotal(sys_users);
        sys_users.setPage((sys_users.getPage()-1)*sys_users.getLimit());
        List<Sys_users> efg = sys_usersService.getSys_users(sys_users);
        return Result.toClient("0","",abc,efg);
    }
}
